package com.atguigu.gmall.activity.redis.listener;

import org.springframework.stereotype.Component;

/**
 * @author 李旭
 * @date 2021/12/10 11:35
 * @Description:
 */
@Component
public class MessageReceive {

    //接收Redis 发布订阅的消息
    public void receiveMessage(String message){

        //  "skuId:1"  小BUG
        message = message.replaceAll("\"","");
        //  skuId:1  将放到本地缓存中   skuId  1
        String[] m = message.split(":");
        //保存在本地缓存中了
        CacheHelper.put(m[0],m[1]);

    }
}
